/**
 * async 函数的返回值一定是一个Promise
 * @returns {Promise<void>}
 */
async function foo() {
  console.log('start')
  console.log('async function run')
  console.log('end')

  //1.返回普通值或对象
  // return {
  //   name: 'lj',
  //   age: 12,
  // }

  //2.返回一个thenable
  // return {
  //   then: function (resolve, reject) {
  //     resolve('hahahaha')
  //   },
  // }

  //3.返回一个Promise
  return new Promise((resolve, reject) => {
    resolve('hehe')
  })
}

const promise = foo()
console.log(promise)
promise.then((res) => {
  console.log(res)
})
